package service;

import java.util.List;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ccc.model.Area;
import com.ccc.service.AreaService;

public class AreaServiceTest {
	
	private static AreaService as;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		try {
			ApplicationContext cxt = new ClassPathXmlApplicationContext("beans.xml");
			as = (AreaService)cxt.getBean("areaService");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	@Test
	public void findAllArea(){
		List<Area> list = as.findAllArea();
		for(Area a : list){
			System.out.println(a.getAreaName());
		}
	}

}
